package com.itheima_04;

import java.util.Scanner;

//  打印奇数：设计一个方法（print）用于打印n到m之间所有的奇数
public class getPrintNumber {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个整数：");
        int n = sc.nextInt();
        System.out.println("请输入第二个整数：");
        int m = sc.nextInt();
        print(n,m);
    }

    private static void print(int n, int m) {
        for (int i = n; i < m; i++) {
            if (i % 2 != 0) {
                System.out.println(i);
            }
        }
    }
}
